package com.ssyt.ec.common.util;

import javax.servlet.http.HttpServletRequest;

import com.ssyt.ec.sys.entity.SysUserEntity;

public class SysuserUtil {
	public static int getUserId(HttpServletRequest request) {
		Object obj = request.getSession().getAttribute("sysUser");
		if (obj != null) {
			SysUserEntity sysUser = (SysUserEntity) obj;
			return sysUser.getId();
		} else {
			return 0;
		}
	}

	public static int getRoleId(HttpServletRequest request) {
		Object obj = request.getSession().getAttribute("sysUser");
		if (obj != null) {
			SysUserEntity sysUser = (SysUserEntity) obj;
			return sysUser.getRoleId();
		} else {
			return 0;
		}
	}
}
